<!--
 * @Author: ljc
 * @Date: 2023-05-05 14:09:40
 * @LastEditors: g05047
 * @LastEditTime: 2023-05-09 20:37:53
 * @Description: 任务详情项目列表
-->
<template>
  <rk-grid style="height: 100%;"
    ref="taskDetileProjectRef"
    dataUrl='/reviewtask/assignApplyPage'
    :boxConfig='false'
    :autoLoad="false"
    :params="assignQueryParams"
    :columns="tableColumns">
  </rk-grid>
</template>

<script setup>
import { ref } from "vue";
import XEUtils from 'xe-utils'
const props = defineProps({
  taskDetaileData: { type: [Object], default: () => ({}) }
})
// 已分配查询参数
let assignQueryParams = reactive({
  projectName: undefined,
  adCode: '2300',
  taskId: undefined
})
const taskDetileProjectRef = ref(null)
watch(
  () => props.taskDetaileData,
  (newValue, oldValue) => {
    nextTick(() => {
      if (!XEUtils.isEmpty(newValue)) {
        assignQueryParams.taskId = newValue.value.taskId
        taskDetileProjectRef.value.searchEvent()
      }
    })
  },
  { deep: true, immediate: false }
)
const tableColumns = ref([
  { field: 'adName', title: '地区', width: 250, align: 'left', },
  {
    field: 'agencyName', title: '单位名称', width: 250, align: 'left',
  },
  { field: 'proCode', title: '项目编码', width: 250, align: 'left', },
  { field: 'proName', title: '项目名称', width: 250, align: 'left', },
  { field: 'setupYear', title: '立项年度', width: 120, align: 'center', },
  { field: 'fundInvestAreaName', title: '资金投向领域', width: 250, align: 'left', },
  { field: 'startDate', title: '开工日期', width: 120, align: 'center', },
  { field: 'endDate', title: '竣工日期', width: 120, align: 'center', },
  {
    field: 'applyAmt',
    title: '申报金额',
    formatter: 'formatThousand',
    width: 200,
    align: 'right'
  },
  {
    field: 'totalBudget',
    title: '项目总概算',
    formatter: 'formatThousand',
    width: 200,
    align: 'right'
  },
  {
    field: 'proCapital',
    title: '项目资本金',
    formatter: 'formatThousand',
    width: 200,
    align: 'right'
  },
  { field: 'remark', title: '备注', width: 250, align: 'left', },
])
</script>
<style lang="scss" scoped>
.mr-15px {
  margin-right: 15px;
  &:last-child {
    margin-right: 0;
  }
}
.w-200px {
  width: 200px;
}
</style>